home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / wordproc / hshell1.arj / PRICES.HYP < prev    next >
Text File  |  1993-12-29  |  3KB  |  153 lines

  1. .REMARK
  2. Price list demo driven by prices.lst file (viz).
  3. Produces order.frm file for printing out. This could also
  4. be done directly to the printer using action 'o'.
  5.  
  6. Note that references in frame, header and footer must appear above
  7. the list if TAB/Shift TAB are to be used to select items.
  8. .HEADER
  9.        [1] ~SNext page~Py;Slist~K1~E~Q  [2] ~SProduce order form~PSorder~K2~E
  10. .SCRIPT SETUP
  11. -- open output file order.dat
  12. worder.dat
  13. .
  14. .NOTE cdplayer
  15. Philips triple overscanned
  16. 4 head multi player with
  17. infra red remote control
  18. .NOTE Television
  19. Ferguson 23" FST with
  20. teletext and stereo
  21. wide angle, with IR
  22. remote control handset
  23. .NOTE Calculator
  24. Casio 3 mips super
  25. handheld holographic
  26. realtime raytracing
  27. four function with
  28. memory calculator.
  29. .REMARK
  30. Display price list a screen full at a time, with wrap around.
  31. .SCRIPT list
  32. -- position text cursor at line 4
  33. i~Y4
  34. -- check run setting 22 (number of open input files) to see if input open
  35. Vr&R22;vr0;jnRESTAT
  36. -- reset variable i
  37. Vi0
  38. -- open input file
  39. rprices.lst
  40. LRESTAT
  41. -- clear error status
  42. Y
  43. LREAD
  44. -- read next line of file, splitting on ',' into variables d, p and g
  45. R,dpg
  46. -- if error status set, assume EOF (end of file)
  47. jsEND
  48. -- calculate character for mapping (a etc), put it in j
  49. Vj=i%16+97;Vj&C$j
  50. Vi=i+1
  51. -- if variable g not defined, goto NODETS
  52. vg;juNODETS
  53. -- set g to reference selecting note called value of g
  54. Vg~ADetails~PN$g~E
  55. LNODETS
  56. -- scale and align price from variable p into s
  57. V&B2$p|s%8s
  58. -- output formatted line to screen
  59. i[$j]~C8~A$d~PSadd($i)~K$j~E~C40£$s~C60$g
  60. -- if not on 16 boundary, loop back
  61. Y=i%16;jnREAD
  62. JPTOT
  63. LEND
  64. -- close input
  65. r
  66. LPTOT
  67. -- scale total value for display
  68. Vu&B2$t
  69. -- display it
  70. i~Y22   TOTAL~C40$u
  71. .
  72. .REMARK
  73. Script add is called with item name as parameter.
  74. Add item, mark line and display total.
  75. .SCRIPT add
  76. -- set k to parameter
  77. Vk$\
  78. -- write to output
  79. W$k
  80. -- refresh mouse cursor coords to get line position
  81. ZG;Vy&Y
  82. -- output asterisk at col 4 on line
  83. i~Y$y~X4*
  84. -- get whole line from price list
  85. Vr@Fprices.lst($k)
  86. -- split out price
  87. er,dp
  88. -- add to total
  89. Vt=t+p
  90. -- scale total for output
  91. Vu&B2$t
  92. -- output total
  93. i~Y22   TOTAL~C40$u
  94. .
  95. .REMARK
  96. Produce order file
  97. Read through data file and fetch items from list file
  98. .SCRIPT order
  99. -- close input and output
  100. r
  101. w
  102. -- open order form as output, with order details as input
  103. worder.frm
  104. rorder.dat
  105. -- output order form
  106. W        ORDER FORM - ELECTRICAL GOODS
  107. W
  108. Vt0
  109. Y
  110. LREAD
  111. -- get item name
  112. Ri
  113. -- at end of file, goto END
  114. jsEND
  115. -- get price
  116. Vr@Fprices.lst($i)
  117. er,dp
  118. -- scale and fill price to 8 places
  119. V&B2$p|s%8s
  120. -- fill name to 30 places, left justified
  121. Vf&W$d|%-30s
  122. -- output name and price
  123. W   $f£$s
  124. -- accumulate total
  125. Vt=t+p
  126. -- loop back
  127. JREAD
  128.  
  129. -- here at end of file
  130. LEND
  131. -- close input
  132. r
  133. W
  134. -- format total line
  135. V&B2$t|s%8s
  136. VfTOTAL|%-30s
  137. W   $f£$s
  138. -- close output
  139. w
  140. -- display order form
  141. Torder.frm
  142. -- exit program
  143. Q
  144. .
  145. .REMARK
  146. test frame
  147. .FRAME test
  148. .TITLE price list test
  149.  
  150.     Description            Price
  151.  
  152. .
  153.